#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
#	include <glf/wp8/socket.h>
#elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
#	include <winsock2.h>
#else
#	include <winsock.h>
#	pragma comment(lib, "ws2_32.lib")
#endif

typedef int socklen_t;

#if !defined(EWOULDBLOCK)
#	define EWOULDBLOCK WSAEWOULDBLOCK
#endif
#if !defined(EISCONN)
#	define EISCONN WSAEISCONN
#endif
#if !defined(ENOTINITIALISED)
#	define ENOTINITIALISED WSANOTINITIALISED
#endif


namespace glf {

NetError Socket::Init() {
	WSADATA wsaData;

	int result = WSAStartup( MAKEWORD(2,2), &wsaData );

	return NETERROR_NONE;
}

NetError Socket::Deinit() {
	int result = WSACleanup();
	
	return NETERROR_NONE;
}

int SocketGetLastError() {
	return WSAGetLastError();
}

}


#include "socket_posix_.hpp"
